UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8xhxRHPdqkzR9yl0o02Ie9KTuFAwpuZsC/3du+pMZ28=' 
WHERE 
  key_id = '5c5f0bc152c9b653b5ae1d1464726cc1a6951be7c3a72bdcf5e42197e1003492' 
  AND (
    token = '8xhxRHPdqkzR9yl0o02Ie9KTuFAwpuZsC/3du+pMZ28=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033