UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wjV7i1ZIMPrgBjKkJVHqrmdHaVkdJA/0Jg9mFrlodec=' 
WHERE 
  key_id = 'd9c7b819bba95ccdf39b250c1af9939c53fdfc5354d6c6425fa084f94bd70265' 
  AND (
    token = 'wjV7i1ZIMPrgBjKkJVHqrmdHaVkdJA/0Jg9mFrlodec=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026