UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xXRfFUc6gwcIa3Qjn8WxiwoTLfRowSKYuVG7sn/zhiM=' 
WHERE 
  key_id = '0ac0b13657ed5ff3a9e40af7d80153e2a9e8f34ba127d68a9d50886c4c8fda9e' 
  AND (
    token = 'xXRfFUc6gwcIa3Qjn8WxiwoTLfRowSKYuVG7sn/zhiM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020