UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '06LxnX9/xfjTQlU5sEU6ykf8dHXRIoFm5LvE1YSmAzQ=' 
WHERE 
  key_id = 'a4277acbbc8c17a0be3f1e32c14fdc9373933d4c934842e95e1bbda7bd92f961' 
  AND (
    token = '06LxnX9/xfjTQlU5sEU6ykf8dHXRIoFm5LvE1YSmAzQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037