UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '048e2NEvP9ZUiUO8H+90Vnk6D5UqSGxk05QpkB2CeCg=' 
WHERE 
  key_id = 'e62b4b931165f625883bccb60c404b26f5d6d596473bd2db7a976fd85a19b64a' 
  AND (
    token = '048e2NEvP9ZUiUO8H+90Vnk6D5UqSGxk05QpkB2CeCg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037