UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ooZj1OrQgKMsLdy9dMHYz953yVl36UACiVnZC3cUwSc=' 
WHERE 
  key_id = 'dc2a19a75adcfa3fa2f1a8fa92646113c4826078a78fab73e1d48548cde1f3e7' 
  AND (
    token = 'ooZj1OrQgKMsLdy9dMHYz953yVl36UACiVnZC3cUwSc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044