UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V0rS84p+ruEqOFlk1757dXgVvh8D5mZPFtrA5hRZ/TU=' 
WHERE 
  key_id = '94b1da3d631d1e5e7e54a39c6701c7a624cc4f4d7287c7457b2e3f66d179bea2' 
  AND (
    token = 'V0rS84p+ruEqOFlk1757dXgVvh8D5mZPFtrA5hRZ/TU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033