UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1wmfvw4IvUvPfN/9QZwcpFtpibgx27n13eqv4QkCvXw=' 
WHERE 
  key_id = 'c5489adf3af55496152c6cd1b831f26b45d3c0135db0ddb3bfc54067633ff69f' 
  AND (
    token = '1wmfvw4IvUvPfN/9QZwcpFtpibgx27n13eqv4QkCvXw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036