UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cIlVWk+xNC4bEXLHIIW0RV7+BbDEg2mknsn1WfW/dDU=' 
WHERE 
  key_id = '574ed8edd8ddd68ed7ef5e3d453df14b576c138527e9fd6d978ea70c6f549cb1' 
  AND (
    token = 'cIlVWk+xNC4bEXLHIIW0RV7+BbDEg2mknsn1WfW/dDU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046