UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'E/wy3D+gH4bw3xJZTE/u/Xu7K/0oyEZP1yHHGmth1hc=' 
WHERE 
  key_id = '76fa1d6d169da08669f02e61cc4feaccb24d5c51577120b048e1dacad30fb62b' 
  AND (
    token = 'E/wy3D+gH4bw3xJZTE/u/Xu7K/0oyEZP1yHHGmth1hc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032