UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1so4t00cWYWtwlWqFiJkA2/uNBos462nPX2F2k7aAeI=' 
WHERE 
  key_id = '440ff3dc68ca8cf9c7fef110b7545cfad9dd53a878f7adc53042540037df454c' 
  AND (
    token = '1so4t00cWYWtwlWqFiJkA2/uNBos462nPX2F2k7aAeI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049