UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '29Vb6OUK/QvX1DIo3kJ/UqZTod8I1Z/e69V2CtqEXwc=' 
WHERE 
  key_id = 'd2576beed5d121b7ac9d31a7dbdebcc31d60875045956b5ae942c988c93bee2c' 
  AND (
    token = '29Vb6OUK/QvX1DIo3kJ/UqZTod8I1Z/e69V2CtqEXwc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031