UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VpZ1eCrdOoU+Qgbk2r26oNz2vh++yc/o1PHzeMmVyvE=' 
WHERE 
  key_id = '5d9fd4b318827b2950806ca27b65b2f80a4473fa435e55fa54da1d8f45b5c2a0' 
  AND (
    token = 'VpZ1eCrdOoU+Qgbk2r26oNz2vh++yc/o1PHzeMmVyvE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029