UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WUpRoV8sp9J6E6RKgSprhqj/eJ7CpHGQ+Z+dq2JCDA8=' 
WHERE 
  key_id = '49dbb1c78bf421126fc9fa91139035cb1c91db3defc258b2e1719d3fdc33d706' 
  AND (
    token = 'WUpRoV8sp9J6E6RKgSprhqj/eJ7CpHGQ+Z+dq2JCDA8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034