UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'r6kQrfVNIaYiXbBzVtL5U8xMBPvfTr4+xU3YG8NNWII=' 
WHERE 
  key_id = '7152ec07fbd8d42ed4466c8dbfa9b42e62ec194aaed3f8ab6a481f8297c2ae64' 
  AND (
    token = 'r6kQrfVNIaYiXbBzVtL5U8xMBPvfTr4+xU3YG8NNWII=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052