UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/JCXIKuUzlLCSzXR+FnMUBX6soBePXlfTFeYxKbDFSM=' 
WHERE 
  key_id = '66dd1e31d6fabf82796b9a3c15e4cdda1b70fa067b8e4e8d970f76ed2c92eea7' 
  AND (
    token = '/JCXIKuUzlLCSzXR+FnMUBX6soBePXlfTFeYxKbDFSM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047