UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'osu6Vo8GJkVQ/hcoS4HLeyV/FcVR0lohlTL7pRANpBY=' 
WHERE 
  key_id = '790b212fc41f28862b5b79a93a399dbfe90a5a40074d73f240b30e548cf4a268' 
  AND (
    token = 'osu6Vo8GJkVQ/hcoS4HLeyV/FcVR0lohlTL7pRANpBY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038