UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4VX6UMBVg1hB0c+6hflTqjnFfJ+WWvj4fmbPJsfbXhU=' 
WHERE 
  key_id = 'cebe6f3faa0abf18d476857f2cdd0dc6a9d7e092b880423e7a4d536dc4a0f114' 
  AND (
    token = '4VX6UMBVg1hB0c+6hflTqjnFfJ+WWvj4fmbPJsfbXhU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022