UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'owXaSjRkpFSAr2BpDhXof6eWrO6WnL71S4ZXj/uMFHE=' 
WHERE 
  key_id = '20d9b79ca631256a3836993b4a72174765189b9ae641fc6ff8d281f0934a2253' 
  AND (
    token = 'owXaSjRkpFSAr2BpDhXof6eWrO6WnL71S4ZXj/uMFHE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049