UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+WpeavCkYJDrPPXgxwUaH/dC0+zGp5g3kkdIfIR2co4=' 
WHERE 
  key_id = 'a1409c3a21ef72d5309404d265e4ff0be20f2f52211642fea6c2f7d986b709a6' 
  AND (
    token = '+WpeavCkYJDrPPXgxwUaH/dC0+zGp5g3kkdIfIR2co4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052