UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bI7RAG8s8IwvArbSjzuxeT4ycyyZWaJAXRejqAagFNQ=' 
WHERE 
  key_id = 'bcdc2e6c76b17c4928d1f9e780ff2a1793bc1e797643c776ffd4821848fec058' 
  AND (
    token = 'bI7RAG8s8IwvArbSjzuxeT4ycyyZWaJAXRejqAagFNQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024