UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vdk2rygZqxKCVLBUZZ/0SMRg/yo389FFl7/nreYReY0=' 
WHERE 
  key_id = '74b7c3048ab2c00c7d364001f58af7c2eab663fcba6bfc2fb4f76ad38a79b87d' 
  AND (
    token = 'Vdk2rygZqxKCVLBUZZ/0SMRg/yo389FFl7/nreYReY0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038