UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4jwYh7tnsP+HMkye0dTxYNcoHgNnlkYl0ah7G1KCuSk=' 
WHERE 
  key_id = '89a919030bf5cc0e5b5790cec9915a30a6f5512fe8691bb33569eba667df2225' 
  AND (
    token = '4jwYh7tnsP+HMkye0dTxYNcoHgNnlkYl0ah7G1KCuSk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030