UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X6M2ZbOw0zAtoFdVtn5+J+6D0hr7lpTAtPae6W10wec=' 
WHERE 
  key_id = '6e8d1f7c3a0de8c2d89b182f0ea9a8f02ca812e70d22951870dbc05f23a6b443' 
  AND (
    token = 'X6M2ZbOw0zAtoFdVtn5+J+6D0hr7lpTAtPae6W10wec=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021