UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pGnmwNLDlNdHDzFpADu269Gj0X0JXjM+YPxf7XS+HIw=' 
WHERE 
  key_id = '19a68d2a3da4012d4b56ec9e7b6554f9926481ee15b045b12b3c5ddcb83d150c' 
  AND (
    token = 'pGnmwNLDlNdHDzFpADu269Gj0X0JXjM+YPxf7XS+HIw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016