UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pZhAYnU/TWGn/0zVFD1yExiLXz+6Y5rsA6QxcjQpPjw=' 
WHERE 
  key_id = '59c1f8f21b92eb6572259c177681d6d7eca14ce21f74d896699e8e18516ec772' 
  AND (
    token = 'pZhAYnU/TWGn/0zVFD1yExiLXz+6Y5rsA6QxcjQpPjw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024