UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z1ULo1+/R/L+pWQlLSpdR5+n8/Ui1pTNWXZYbJCnLS4=' 
WHERE 
  key_id = 'df37d5b7379ab345de849d5f316265154cc40a2ae50b04e9b71fb7a35fb1d60f' 
  AND (
    token = 'z1ULo1+/R/L+pWQlLSpdR5+n8/Ui1pTNWXZYbJCnLS4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020