UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1ej6r99RxFNXZ2h5EeqcGYPR1ZzmGPVQVwn/nHiO3nY=' 
WHERE 
  key_id = '23841d53c884c4f545fbe6bbd7c0bca1c8ecd18100ccc402602738673509d473' 
  AND (
    token = '1ej6r99RxFNXZ2h5EeqcGYPR1ZzmGPVQVwn/nHiO3nY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044