UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7P2TMPHgBPFj/P1Y7CPtM4tzSaL2ADUTi7SzSkJPYpM=' 
WHERE 
  key_id = '023ef902cb7bd49213de98c4ee7a9e723ce6627cbd46f1b2ef1688324f40d141' 
  AND (
    token = '7P2TMPHgBPFj/P1Y7CPtM4tzSaL2ADUTi7SzSkJPYpM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027