UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EpyiP0JJFFoiNKyXoGt0laclUkAqMNPpWqINJlsuZ0I=' 
WHERE 
  key_id = '1bb83358ca5bc5d7b5a538b6850b9e6aede87037cbfaafb683a33697a83b890f' 
  AND (
    token = 'EpyiP0JJFFoiNKyXoGt0laclUkAqMNPpWqINJlsuZ0I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026