UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vfPle/VgFFdnQX3SijkMo+ylkoOkarEnLP4iSG9idZc=' 
WHERE 
  key_id = '7488469c45bc19073837889cf50c82448e6a724c6ce2234b451280e176456cea' 
  AND (
    token = 'vfPle/VgFFdnQX3SijkMo+ylkoOkarEnLP4iSG9idZc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029