UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't64jUygbwYaD3omtB3wjy/9bvSRquz3GLMbWuqltPd4=' 
WHERE 
  key_id = '23867b0f4950cec222452040bdbf626dbb9d8ca09efb7b7acef2a5a7249545ad' 
  AND (
    token = 't64jUygbwYaD3omtB3wjy/9bvSRquz3GLMbWuqltPd4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029