UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/+308eLYDt8NnNyTm/P5LmvjW+0fQpz99+DaaXzraDk=' 
WHERE 
  key_id = 'bfadd04509bfb92ecd2aa6f8ec3427915bd495a4c49eafb49cd2955a7a66d00f' 
  AND (
    token = '/+308eLYDt8NnNyTm/P5LmvjW+0fQpz99+DaaXzraDk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027